<?php
// +----------------------------------------------------------------------
// | @filename MenuHasRole.php
// +----------------------------------------------------------------------
// | @author 落花轻舞问君愁 <mwcx1990@qq.com>
// +----------------------------------------------------------------------
// | @datetime 2021-11-02 13:10:06
// +----------------------------------------------------------------------
// | @Description
// +----------------------------------------------------------------------

namespace Addons\Backend\Repositories;

use Addons\Backend\Models\MenuHasRole;

class MenuHasRoleRepository extends BaseRepository
{
    protected $model;

    public function __construct(MenuHasRole $menuHasRole)
    {
        $this->model = $menuHasRole;
    }

    public function deleteByCondition($condition){
        return $this->model::query()->where($condition)->delete();
    }

    /**
     * 批量插入
     * @param $data
     * @return bool
     */
    public function batchInsert($data): bool
    {
        return $this->model::query()->insert($data);
    }
}
